package com.hxq.library.service;

import com.hxq.library.entity.User;

import java.sql.SQLException;

/**
 * @Author: Ljx
 * @Date: 2021/11/24 13:29
 * @role:
 */
public interface IUserService {

    /**
     * 注册用户
     * @param user
     * @return
     */
    boolean login(User user) throws SQLException;

    /**
     * 登录用户
     * @param account
     * @param password
     * @return
     */
    boolean register(String account, String password);

    /**
     * 余额充值
     * @param money
     * @param account
     * @param password
     * @param number
     * @return
     * @throws SQLException
     */
    boolean pay(int money,String account,String password,String number) throws SQLException;

    /**
     * 查询余额
     * @param account
     * @return
     * @throws SQLException
     */
    int selectMoney(String account) throws SQLException;

    /**
     * 充值VIP
     * @param account
     * @return
     * @throws SQLException
     */
    int payVip(String account) throws SQLException;

    /**
     * 查询vip
     * @param account
     * @return
     * @throws SQLException
     */
    int selectVip(String account) throws SQLException;

    /**
     * 更改密码
     * @param account
     * @param oldPassword
     * @param password
     * @return
     * @throws SQLException
     */
    boolean changePassword(String account,String oldPassword,String password) throws SQLException;

    /**
     * 忘记密码
     * @param account
     * @param number
     * @param code
     * @return
     * @throws SQLException
     */
    boolean forgetPassword(String account, String number, String code) throws SQLException;

    /**
     * 忘记密码后更新密码操作
     * @param account
     * @param newPassword
     * @return
     * @throws SQLException
     */
    boolean changePassword(String account, String newPassword) throws SQLException;

    /**
     * 查询用户是否存在
     * @param account
     * @return
     * @throws SQLException
     */
    boolean selectUser(String account) throws SQLException;
}
